<template>
  <div class="div_reg">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <el-button style="float: left; padding: 3px 0" type="prev" @click="prev"
          >上一步</el-button
        >
        <span class="spanmsg"> {{ spanmsg }} </span>
        <el-button
          style="float: right; padding: 3px 0"
          type="text"
          @click="next"
          >下一步</el-button
        >
      </div>
      <el-container>
        <el-main>
          <el-col>
            <el-carousel
              class="welcome"
              :autoplay="false"
              arrow="never"
              indicator-position="none"
              ref="nop"
              :interval="50000"
            >
              <el-carousel-item>
                <el-form
                  :model="empForm"
                  :rules="rules"
                  ref="ruleForm"
                  label-width="100px"
                  class="empForm"
                >
                  <el-form-item label="登录名" prop="logid">
                    <el-input v-model="empForm.logid"></el-input>
                  </el-form-item>
                </el-form>
              </el-carousel-item>

              <el-carousel-item> 2 </el-carousel-item>
              <el-carousel-item> 3 </el-carousel-item>
            </el-carousel>
          </el-col>
        </el-main>
        <el-footer>
          <el-steps :active="active" finish-status="success" align-center>
            <el-step title="步骤 1"></el-step>
            <el-step title="步骤 2"></el-step>
            <el-step title="步骤 3"></el-step> </el-steps
        ></el-footer>
      </el-container>
    </el-card>
  </div>
</template>

<script>
// @ is an alias to /src
// import BasicEmpReg from '@/components/BasicEmpReg.vue'
export default {
  name: 'Empreg',
  data() {
    return {
      active: 0,
      msgs: ['基础信息', '人员信息', '工作信息'],
      spanmsg: '基础信息',
      empForm: {
        logid: ''
      },

      rules: {
        logid: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    next() {
      if (this.active++ > 2) this.active = 0
      this.$refs.nop.setActiveItem(this.active)
      this.spanmsg = this.msgs[this.active]
    },
    prev() {
      if (this.active-- < 0) this.active = 0
      this.$refs.nop.setActiveItem(this.active)
      this.spanmsg = this.msgs[this.active]
    }
  },
  components: {}
}
</script>

<style lang="less" scoped>
.spanmsg {
  font-size: 18px;
}
.el-carousel__item {
  padding: 20px;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.div_reg {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center; /*垂直居中*/
}
.main_view {
  display: flex;
  font-size: 14px;
  margin-bottom: 18px;
}

.el-input__inner {
  width: 85%;
}

.box-card {
  width: 800px;
  height: 700px;
  .clearfix {
    height: 20px;
  }
  .el-container {
    height: 600px;
    .el-main {
      background-color: #e9eef3;
      color: #333;
    }
    .el-footer {
      background-color: #e9eef3;
      color: #333;
    }
  }
}
</style>
